package cn.test.abstractfactory;

import cn.test.abstractfactory.factory.FemaleFactory;
import cn.test.abstractfactory.factory.HumanFactory;
import cn.test.abstractfactory.factory.MaleFactory;
import cn.test.abstractfactory.product.Human;
import org.junit.Test;

/**
 * @author zengfh
 * @ClassName NvWa
 * @Description
 * @date: 2017/10/12 19:53
 */
public class NvWa {
    @Test
    public void test() {
        HumanFactory maleHumanFactory = new MaleFactory(); //第一条生产线：男性生产线
        HumanFactory femaleHumanFactory = new FemaleFactory(); //第二条生产线：女性生产线
        
        //生产线建立完毕，开始造人
        Human maleYellowHuman = maleHumanFactory.createYellowHuman(); //造黄色男性
        Human femaleYellowHuman = femaleHumanFactory.createYellowHuman(); //造黄色女性
        
        System.out.println("--生产一个黄色女性--");
        femaleYellowHuman.getColor();
        femaleYellowHuman.talk();
        femaleYellowHuman.getSex();
        
        System.out.println("--生产一个黄色男性--");
        maleYellowHuman.getColor();
        maleYellowHuman.talk();
        maleYellowHuman.getSex();
        /*
         * ……
         */
    }
}
